//
//  FunnyModel.m
//  Snigger
//
//  Created by 火火火火火 on 16/8/16.
//  Copyright © 2016年 Smile. All rights reserved.
//

#import "FunnyModel.h"

@implementation FunnyModel

// 成员变量
{
    CGFloat _cellHeight;
}

- (CGFloat)cellHeight{
    if (!_cellHeight) {
        // 文字的最大尺寸
        CGSize maxSize = CGSizeMake([UIScreen mainScreen].bounds.size.width -  2 * MovieCellMargin, MAXFLOAT);
        // 计算文字的高度
        CGFloat titleH = [self.wbody boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil].size.height;
        
        // 文字部分的高度
        _cellHeight = MovieCellTextY + titleH + MovieCellMargin;
        
        //        // 图片高度
        _cellHeight += self.wpic_m_height;
        
        //        // 底部工具条的高度
        _cellHeight += MovieCellBottonBarH + MovieCellMargin;
    }
    
    return _cellHeight;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

@end
